package com.fr.chart.plot;

import com.fr.base.xml.XMLPrintWriter;
import com.fr.base.xml.XMLableReader;
import com.fr.chart.core.glyph.Bar2DPlotGlyph;
import com.fr.chart.core.glyph.PlotGlyph;
import com.fr.data.ChartData;

public class Bar2DPlot extends BarPlot
{
  private static final long serialVersionUID = 7944953095383884004L;
  private boolean isSimulation3D = true;

  public Bar2DPlot()
  {
  }

  public PlotGlyph createPlotGlyph(ChartData paramChartData)
  {
    Bar2DPlotGlyph localBar2DPlotGlyph = new Bar2DPlotGlyph();
    localBar2DPlotGlyph.setSimulation3D(this.isSimulation3D);
    install4PlotGlyph(localBar2DPlotGlyph, paramChartData);
    installAxisGlyph(localBar2DPlotGlyph, paramChartData);
    return localBar2DPlotGlyph;
  }

  public Bar2DPlot(boolean paramBoolean)
  {
    this.isHorizontal = paramBoolean;
  }

  public void setSimulation3D(boolean paramBoolean)
  {
    this.isSimulation3D = paramBoolean;
  }

  public boolean isSimulation3D()
  {
    return this.isSimulation3D;
  }

  public void readXML(XMLableReader paramXMLableReader)
  {
    super.readXML(paramXMLableReader);
    if (paramXMLableReader.isChildNode())
    {
      String str;
      if ((str = paramXMLableReader.getAttr("isSimulation3D")) != null)
        setSimulation3D(Boolean.valueOf(str).booleanValue());
    }
  }

  public void writeXML(XMLPrintWriter paramXMLPrintWriter)
  {
    paramXMLPrintWriter.startTAG("Plot");
    super.writeXML(paramXMLPrintWriter);
    paramXMLPrintWriter.startTAG("Bar2DAttr").attr("isSimulation3D", this.isSimulation3D).end();
    paramXMLPrintWriter.end();
  }

  public boolean equals(Object paramObject)
  {
    if (!(paramObject instanceof Bar2DPlot))
      return false;
    Bar2DPlot localBar2DPlot = (Bar2DPlot)paramObject;
    if (!(super.equals(localBar2DPlot)))
      return false;
    return (localBar2DPlot.isSimulation3D == this.isSimulation3D);
  }
}